package jihyun51.swing;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.GridLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Grid_Layout extends JDialog {

	private final JPanel contentPanel = new JPanel();

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		try {
			Grid_Layout dialog = new Grid_Layout();
			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			dialog.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Create the dialog.
	 */
	public Grid_Layout() {
		setTitle("Grid_Layout");
		setBounds(100, 100, 640, 480);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(new GridLayout(3, 4, 15, 15));
		{
			JButton btnNewButton = new JButton("New button");
			contentPanel.add(btnNewButton);
		}
		{
			JButton btnNewButton_2 = new JButton("New button");
			contentPanel.add(btnNewButton_2);
		}
		{
			JButton btnNewButton_3 = new JButton("New button");
			contentPanel.add(btnNewButton_3);
		}
		{
			JButton btnNewButton_4 = new JButton("New button");
			contentPanel.add(btnNewButton_4);
		}
		{
			JButton btnNewButton_1 = new JButton("New button");
			contentPanel.add(btnNewButton_1);
		}
		{
			JButton btnNewButton_6 = new JButton("New button");
			contentPanel.add(btnNewButton_6);
		}
		{
			JButton btnNewButton_5 = new JButton("New button");
			contentPanel.add(btnNewButton_5);
		}
		{
			JButton btnNewButton_7 = new JButton("New button");
			contentPanel.add(btnNewButton_7);
		}
		{
			JButton btnNewButton_9 = new JButton("New button");
			contentPanel.add(btnNewButton_9);
		}
		{
			JButton btnNewButton_8 = new JButton("New button");
			contentPanel.add(btnNewButton_8);
		}
		{
			JButton btnNewButton_12 = new JButton("New button");
			contentPanel.add(btnNewButton_12);
		}
		{
			JButton btnNewButton_10 = new JButton("New button");
			contentPanel.add(btnNewButton_10);
		}
		{
			JPanel buttonPane = new JPanel();
			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
			getContentPane().add(buttonPane, BorderLayout.SOUTH);
			{
				JButton okButton = new JButton(" 확인 ");
				okButton.setActionCommand("OK");
				buttonPane.add(okButton);
				getRootPane().setDefaultButton(okButton);
			}
		}
	}

}
